<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/tern/tern-tags.tld" prefix="tern"%>
<tern:page pageForm="teacher.SubmitPage">
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>学生各项实验信息</title>
<meta http-equiv="pragma" content="no-cache" />
     <meta http-equiv="cache-control" content="no-cache" />
     <meta http-equiv="expires" content="0" />  
     <link href="${applicationScope.root}js/toolbar/toolbar.css"
	 rel="stylesheet" type="text/css" /> 
     <link rel="stylesheet" type="text/css" href="${applicationScope.root}skins/default/main.css">
     <link type="text/css" href="${applicationScope.root}js/themes/ui-lightness/jquery.ui.all.css" rel="stylesheet" />
     <script type="text/javascript" src="${applicationScope.root}js/jquery.min.js"></script>  
     <script type="text/javascript" src="${applicationScope.root}js/ui/jquery-ui.min.js"></script>   
     <script type="text/javascript" src="${applicationScope.root}js/toolbar/toolbar.js"></script>      
     <script type="text/javascript" src="${applicationScope.root}js/util.js"></script>
<script language="javascript">
$(function() {
	$("#toolbar1").commonBar(
			{
				rootPath : '${applicationScope.root}js/toolbar/',
				commandClick : function(cmd) {
					var id = firstChecked('submitID');		
						 if (cmd == 'detail') {
						if (id == null) {
							alert('您没有选中任何数据!');
							return;
						} else {
							openDialog('info.jsp?id=' + id + '&time='+ (new Date()).getTime(),"info",400,500,450,100);
						}
					
					}else if(cmd == 'score'){
						if (id == null) {
							alert('您没有选中任何数据!');
							return;
						} else {
							var stuID=document.getElementById("stuID"+id).value;
							var testID=document.getElementById("testID"+id).value;
							score(id,stuID,testID);
						}
						
					}else if(cmd == 'paperscore'){
						if (id == null) {
							alert('您没有选中任何数据!');
							return;
						} else {
							var stuID=document.getElementById("stuID"+id).value;
							var testID=document.getElementById("testID"+id).value;
							paperscore(id,stuID,testID);
						}
						
					}else if (cmd == "del") {
						if (id == null) {
							alert('您没有选中任数据!');
							return;
						} else {
							askYesOrNo({
								message : '您确实要删除选中的数据吗？',
								onok : function() {
									$('#myForm').onevent('onDel', id);
								}
							});
						}
					}
				}
			});
	function score(id,stuID,testID){
		if(id!=0){
			openDialog('submitEdit.jsp?id=' + id + '&time='+ (new Date()).getTime(),"submitEdit",400,500,450,100);
		}else{
			openDialog('submitEdit.jsp?stuID=' +stuID + '&testID='+testID+'&time='+ (new Date()).getTime(),"submitEdit",400,500,450,100);
		}
	}
	function paperscore(id,stuID,testID){
		if(id!=0){
			openDialog('submitPaperEdit.jsp?id=' + id + '&time='+ (new Date()).getTime(),"submitEdit",400,500,450,100);
		}else{
			openDialog('submitPaperEdit.jsp?stuID=' +stuID + '&testID='+testID+'&time='+ (new Date()).getTime(),"submitEdit",400,500,450,100);
		}
	}
	
});
function downF(id){
	 window.location.href = 'download?id=' + id + '&&'
		+ 'index=' + 1;
}

function downL(id){
	 window.location.href = 'download?id=' + id + '&&'
		+ 'index=' + 2;
}


</script>
</head>
<style type="text/css">
body {
margin: 0px 8px 8px;
}
</style>
<body>
	<tern:form method="post" id="myForm">
			 <ul id="toolbar1">
  		<li>-</li><li>-</li>
		 
		<li style="width:100px">
		<img
			src="${applicationScope.root}skins/common/bt_del.png" /><a
			href='#del'>删除</a>
		</li>
		 
		<li style="width:100px"> <img
			src="${applicationScope.root}skins/common/bt_print.png" /><a
			href='#detail'>批注信息</a>
		</li>
		<li style="width: 120px"><img
			src="${applicationScope.root}skins/common/bt_edit.png" /><a
			href='#score'>实验源码评分</a>
		</li>
		<li style="width: 120px"><img
			src="${applicationScope.root}skins/common/bt_edit.png" /><a
			href='#paperscore'>实验报告评分</a>
		</li>
	</ul>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>  
        <td>         
           <div class="title"><span>当前位置：</span>教学管理 &gt; 成绩管理 &gt; 学生各项实验</div> 
           </td>         
        </tr>         
      </table>
		<tern:table id="enTable" dataSource="${page.submit}">
			<tern:theader>
				<tern:tcell width="4%" height="24" align="center">选择</tern:tcell>
				<tern:tcell align="center">学生</tern:tcell>
				<tern:tcell align="center">实验编号</tern:tcell>
				<tern:tcell align="center">教师评分 </tern:tcell>
				<tern:tcell align="center">最早提交自动成绩 </tern:tcell>
				<tern:tcell align="center">最早提交时间 </tern:tcell>
<%-- 				<tern:tcell align="center">最早提交批注 </tern:tcell> --%>
				<tern:tcell align="center">最早提交源代码 </tern:tcell>
				<tern:tcell align="center">最近提交自动成绩 </tern:tcell>
				<tern:tcell align="center">最近提交时间 </tern:tcell>
<%-- 				<tern:tcell align="center">最近提交批注 </tern:tcell> --%>
				<tern:tcell align="center">最近提交源代码 </tern:tcell>
				<tern:tcell align="center">实验报告 </tern:tcell>
			</tern:theader>
			<tern:trow>
				<tern:tcell height="22" align="center">
					<input value='${item.submitID}' name="submitID" type="radio" />
				</tern:tcell>
				<tern:tcell>&nbsp;${item.stuID}
				<input type="hidden" id="stuID${item.submitID}" value="${item.stuID.value}">
				</tern:tcell>
				<tern:tcell>&nbsp;${item.testID}
				<input type="hidden" id="testID${item.submitID}" value="${item.testID.value}">
				</tern:tcell>
				<tern:tcell>&nbsp;${item.teacherSourseScore}</tern:tcell>
				<tern:tcell>&nbsp;${item.firstScore}</tern:tcell>
				<tern:tcell>&nbsp;${item.firstTime}</tern:tcell>
<%-- 				<tern:tcell>&nbsp;${item.firstInfo}</tern:tcell> --%>
				<tern:tcell>
					<c:if test="${item.firstTime !=null}">
						<a href="javascript:downF(${item.submitID})">下载</a>
					</c:if>
				</tern:tcell>
				<tern:tcell>&nbsp;${item.lastScore}</tern:tcell>
				<tern:tcell>&nbsp;${item.lastTime}</tern:tcell>
<%-- 				<tern:tcell>&nbsp;${item.lastInfo}</tern:tcell> --%>
				<tern:tcell>
					<c:if test="${item.lastTime !=null}">
						<a href="javascript:downL(${item.submitID})">下载</a>
					</c:if>
				</tern:tcell>
				<tern:tcell>
					<c:if test="${item.paperType!=null}">
						 <a href="#" onClick="window.open('${applicationScope.root}teacher/download?id=${item.submitID}&type=paper')">查看</a>
					</c:if>
				</tern:tcell>

<%-- 				<tern:tcell><img --%>
<%-- 						src="<%=request.getContextPath()%>/skins/common/icon_edit.gif" --%>
<!-- 						alt="修改" />			 -->
<%-- 						<a href="javascript:score(${item.submitID},${item.stuID.value},${item.testID})">编辑</a> --%>
<%-- 				</tern:tcell> --%>
			</tern:trow>
		</tern:table>
		<input name="b_refreah" type="button" value="刷新" style="display: none"
			onClick="on_event('onRefresh','')" />
	</tern:form>
</body>
	</html>
</tern:page>
